home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / Graphic Gems I, II & III (C_C++) / Graphics Gems C Code.sea / GemsIII / partition3d / partition.h < prev   
Text File  |  1992-06-16  |  1KB  |  58 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. /* partition.h: header file for partition module.
  19.  * Copyright (c) Norman Chin
  20.  */
  21. #ifndef _PARTITION_INCLUDED
  22. #define _PARTITION_INCLUDED
  23.  
  24. typedef enum { ZERO, NEGATIVE, POSITIVE } SIGN;
  25.  
  26. typedef struct vertexTag {
  27.    double xx,yy,zz;        /* 3D coordinates of vertex */
  28.  
  29.    struct vertexTag *vnext;    /* ptr to next vertex */
  30. } VERTEX;
  31. #define NULL_VERTEX ((VERTEX *) NULL)
  32.  
  33. typedef struct {
  34.    int someInfo; /* some face info goes here, ie. material properties */
  35.    
  36.    VERTEX *vhead;        /* ptr to first vertex of face */
  37. } FACE; 
  38. #define NULL_FACE ((FACE *) NULL)
  39.  
  40. #define TOLER 0.000001
  41. #define ISDOUBLE_EQ(a,b) ((fabs((a)-(b)) >= (double) TOLER) ? 0 : 1)  
  42.  
  43. #define ISVERTEX_EQ(v1,v2) \
  44.                           (ISDOUBLE_EQ((v1)->xx,(v2)->xx) && \
  45.                            ISDOUBLE_EQ((v1)->yy,(v2)->yy) && \
  46.                            ISDOUBLE_EQ((v1)->zz,(v2)->zz))
  47. #define FREEVERTEX(v) (free((char *) (v)))
  48.  
  49. /* external functions */
  50. void partitionFaceWithPlane(/* double aa, double bb, double cc, double dd,
  51.                    FACE *face, FACE **faceOn, 
  52.                    FACE **faceNeg, FACE **facePos
  53.                      */
  54.                );
  55. #endif _PARTITION_INCLUDED
  56.  
  57.  
  58.